import api from '../../api/contactsInfo.js'

const state = {

}

const actions = {
    //日志分页查询
    contactsInfoList({commit}, params){
        return new Promise((resolve,reject) => {
            api.contactsInfoList(params).then(res => {
                resolve(res)
            }).catch(error => {
                reject(error)
            })
        })
    },
    //新增
    addContactsInfo({commit}, params){
        return new Promise((resolve,reject) => {
            api.addContactsInfo(params).then(res => {
                resolve(res)
            }).catch(error => {
                reject(error)
            })
        })
    },
    // 详情
    contactsInfoDetail({commit},id){
        return new Promise((resolve,reject) => {
            api.contactsInfoDetail(id).then(res => {
                resolve(res)
            }).catch(error => {
                reject(error)
            })
        })
    },
    // 删除
    deleteContactInfo({commit},id){
        return new Promise((resolve,reject) => {
            api.deleteContactInfo(id).then(res => {
                resolve(res)
            }).catch(error => {
                reject(error)
            })
        })
    },
    // 更新
    updateContact({commit}, params){
        return new Promise((resolve,reject) => {
            api.updateContact(params).then(res => {
                resolve(res)
            }).catch(error => {
                reject(error)
            })
        })
    },
}

const getters = {

}

const mutations = {

}

export default{
    namespaced: true,
    state,
    actions,
    getters,
    mutations
}
